#!/bin/bash

term=termite

declare options=("qtile
polybar
vim
aliases
zshrc
picom
i3
termite
dunst
xresources
")

choice=$(echo -e "${options[@]}" | dmenu -i -p 'Edit config file: ')

case "$choice" in
	dunst) choice="$HOME/.config/dunst/dunstrc" ;;
	i3) choice="$HOME/.config/i3/config" ;;
	picom) choice="$HOME/.config/picom/config" ;;
	polybar) choice="$HOME/.config/polybar/" ;;
	qtile) choice="$HOME/.config/qtile/config.py" ;;
	termite) choice="$HOME/.config/termite/config" ;;
	vim) choice="$HOME/.vimrc" ;;
	xresources) choice="$HOME/.Xresources" ;;
	zshrc) choice="$HOME/.zshrc" ;;
	aliases) choice="$HOME/.alias_zsh" ;;
	*) exit 1 ;;
esac

cd $HOME

dir=${choice%/*}
# name="ranger $choice"
name="nvim $choice"

$term -e "$name" -t "$name"
